Inventory Billing Management System using Flask
BillSwift: Inventory Billing Management System
π οΈ Description
BillSwift is a comprehensive billing solution that empowers merchants to effortlessly create, generate, and manage bills, track inventory and products, and optimize their billing processes. With BillSwift, you can bid farewell to tedious paperwork and embrace a more efficient way of running your business. ### π Key Features: - Intuitive Bill Creation: Easily create professional invoices allowing you to add your branding and personal touch. - Inventory Management: Keep track of your products and manage stock levels. - Bill Tracking: Monitor the status of your bills, know which ones are paid and pending, and never miss a payment again.
βοΈ Languages or Frameworks Used
- Flask
- Firebase (for Authentication)
- MongoDB (for data storage)
π How to run
Install all the requirements
Runpip install -r requirements.txtto install all the requirements.Firebase Setup for Project
Create a firebase project, set up a web project and get all the
Project ConfigurationsfromProject Settings.Navigate to the Authentication section in your firebase project and enable the
Email and Passwordauthentication.The
Project Configurationswill look as follows :-
"apiKey": YOUR_API_KEY , "authDomain": YOUR_AUTH_DOMAIN, "databaseURL": YOUR_DATABASEURL, "projectId": YOUR_PROJECT_ID, "storageBucket": YOUR_STORAGE_BUCKET, "messagingSenderId": YOUR_MESSAGING_SENDER_ID, "appId": YOUR_APP_ID, "measurementId": YOUR_MEASUREMENT_IDMongoDB Setup for Project
- Download monogdb from the official website and setup in your local system for testing.
- Once it is setup locally, try creating documents and collections in mongodb to familiarize yourself with it.
- You can also download the
MongoDB Compass, which is the GUI version of Mongo Shell. - Once all the local testing is done, you can create a free cloud version of MongoDB in MongoDB Atlas and get the following credentials from the dashboard of atlas:
MONGO_URI=YOUR_MONGO_URI MONGO_USERNAME=YOUR_MONGO_USERNAME MONGO_PASSWORD=YOUR_MONGO_PASSWORDSetup Environment for the project
- Now create a
.envfile in your project dreictory and include the following parameters as it is :-
export ENVIRONMENT=local/production export APP_SECRET=YOUR_APP_SECRET export MONGO_URI=YOUR_MONGO_URI export MONGO_USERNAME=YOUR_MONGO_USERNAME export MONGO_PASSWORD=YOUR_MONGO_PASSWORD export DB_NAME=YOUR_MONGODB_DATABASE_NAME export FIREBASE_APIKEY=YOUR_API_KEY export FIREBASE_AUTHDOMAIN=YOUR_AUTH_DOMAIN export FIREBASE_DATABASEURL=YOUR_DATABASEURL export FIREBASE_PROJECT_ID=YOUR_PROJECT_ID export FIREBASE_STORAGE_BUCKET=YOUR_STORAGE_BUCKET export FIREBASE_MESSAGING_SENDER_ID=YOUR_MESSAGING_SENDER_ID export FIREBASE_APP_ID=YOUR_APP_ID export FIREBASE_MEASUREMENT_ID=YOUR_MEASUREMENT_ID- Now create a
Now Just, Run the project
- To the run the project, go to the
bashterminal of VSCode or any other code editor and run./start_server.sh. - The server would start running on
http://127.0.0.1:{port_number}.(generally http://127.0.0.1:5000)
- To the run the project, go to the
Login/Signup as a user
Since, you are a new user, singup in the application and then login. Then, Start Exploring the project! > Note: You will recieve a email verification mail from firebase upon singup and then only you can proceed
πΊ Demo
- Login/Singup Screen.

Main screen of the application (Bill generation)

Product Screen/ Adding products

Note: This is where you can manage the inventory of a product by editing it.
- All Bills Page

- Bill generation in PDF Format.

Source Code: db.py
import os
import pymongo
ENVIRONMENT = os.environ["ENVIRONMENT"]
if ENVIRONMENT == "local":
connection_string = "mongodb://localhost:27017"
DB_NAME = "billing_system"
else:
MONGO_CLUSTER = os.environ["MONGO_URI"]
MONGO_USERNAME = os.environ["MONGO_USERNAME"]
MONGO_PASSWORD = os.environ["MONGO_PASSWORD"]
DB_NAME = os.environ["DB_NAME"]
connection_string = f"mongodb+srv://{MONGO_USERNAME}:{MONGO_PASSWORD}@{MONGO_CLUSTER}/?retryWrites=true&ssl=true&ssl_cert_reqs=CERT_NONE&w=majority"
db_client = pymongo.MongoClient(connection_string)
db_client = db_client.get_database(DB_NAME)
products_collection = db_client['products']
invoices_collection = db_client['invoices']
users_collection = db_client['users']